package com.restfinder.common.component;

import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;

import org.omnifaces.util.Faces;
import org.omnifaces.util.Messages;

public class FacesUtils {

	public static void putIntoFlashScope(String key, String value){
		Faces.setFlashAttribute(key, value);
	}
	
	public static String getFromFlashScope(String key){
		return Faces.getFlashAttribute(key);
	}
	
	public static void addErrorMessage(String header, String content){
		FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR,header, content));
	}
}
